package com.xtwy.controller;

import com.xtwy.service.EhCacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类的描述：
 *
 * @作者: 侯建军
 * @邮箱: 474177818@qq.com
 * @博客: https://blog.csdn.net/marquis888
 * @创建日期: 2018年12月06日  5:12
 * @版本: v1.0
 * @jdk版本使用: JDK1.8
 */
@RestController
@RequestMapping("/ehcache")
public class EhCacheController {
    @Autowired
    public EhCacheService ehCacheService;

    @GetMapping("/read")
    public String readEhCache(){
        return ehCacheService.readCache();
    }

    @GetMapping("/deleteAll")
    public String deleteAll(){
         ehCacheService.deleteAll();
        return  "移除成功";
    }

    @GetMapping("/update")
    public String update(){
        ehCacheService.update();
        return  "更新成功";
    }
}
